processor l False
`finally` void cleanup
- -- Avoid running smudge clean filter, which would block trying to
- -- access the locked database. git write-tree sometimes calls it,
- -- even though it is not adding work tree files to the index,
- -- and so the filter cannot have an effect on the contents of the
- -- index or on the tree that gets written from it.
- getindextree = inRepo $ \r -> writeTreeQuiet $ r
- { gitGlobalOpts = gitGlobalOpts r ++ bypassSmudgeConfig }
+ -- This avoids running git write-tree when run by the smudge clean
+ -- filter, in order to work around a bug in git. That causes
+ -- git merge to fail with an internal error when git write-tree is
+ -- run by the smudge clean filter in conflicted merge situation.
+ --
+ -- When running git write-tree, avoid it running the smudge clean
+ -- filter, which would block trying to access the locked database.
+ -- git write-tree sometimes calls it, even though it is not adding
+ -- work tree files to the index, and so the filter cannot have an
+ -- effect on the contents of the index or on the tree that gets
+ -- written from it.
+ getindextree = ifM (Annex.getState Annex.insmudgecleanfilter)
+ ( return Nothing
+ , inRepo $ \r -> writeTreeQuiet $ r
+ { gitGlobalOpts = gitGlobalOpts r ++ bypassSmudgeConfig }
+ )
+ notneeded = isBareRepo
+ -- Avoid doing anything when run by the
+ -- smudge clean filter. When that happens in a conflicted
+ -- merge situation, running git write-tree
+ -- here would cause git merge to fail with an internal
+ -- error. This works around around that bug in git.
+ <||> Annex.getState Annex.insmudgecleanfilter
+
diff old new =
-- Avoid running smudge clean filter, since we want the
-- raw output, and it would block trying to access the